package pagelib;

public class Services extends Page {

	static final String msgString =("//DIV[@id='textMessagingPlans']/DIV[2]/DIV");
	static final String addButton1=("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[2]/DIV/A");
	static final String addButton2=("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[8]/DIV/A");
	
	static final String smartPhoneOptBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[3]/DIV[2]/TABLE/TBODY/TR[1]/TD[3]/INPUT");
	static final String smartPhoneWebPlanDtl = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[3]/DIV[1]/DIV/A");
	static final String smartPhoneWebPlanPrice = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[3]/DIV[2]/TABLE/TBODY/TR[1]/TD[2]/LABEL");
	
	static final String textMessgingPlanDtl = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[1]/DIV/A");
	static final String indTextMsg300Price = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[2]/TABLE/TBODY/TR[1]/TD[2]/LABEL");
	static final String indTextMsgOptBtn=("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[2]/TABLE/TBODY/TR[1]/TD[3]/INPUT");
	static final String unlimitedIndTextPlanPrice = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[2]/TABLE/TBODY/TR[2]/TD[2]/LABEL");
	static final String UnlimitedIndTextoptBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[2]/TABLE/TBODY/TR[2]/TD[3]/INPUT");
	static final String noneTextMsgOptionBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[4]/DIV[2]/TABLE/TBODY/TR[3]/TD[3]/INPUT");
	static final String phoneInsuranceDtl =("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[5]/DIV[1]/DIV/A");
	static final String phoneInsurancePrice = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[5]/DIV[2]/TABLE/TBODY/TR[1]/TD[2]/LABEL");
	static final String phoneInsuranceOptBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[5]/DIV[2]/TABLE/TBODY/TR[1]/TD[3]/INPUT");
	static final String nonePhoneInsuranceOptBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[5]/DIV[2]/TABLE/TBODY/TR[2]/TD[3]/INPUT");
	static final String moreMinutesDetails = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[6]/DIV[1]/DIV/A");
	static final String talkingLiberallyDetails = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[7]/DIV[1]/DIV/A");
	static final String moreMinutesPrice = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[6]/DIV[2]/TABLE/TBODY/TR[1]/TD[2]/LABEL");
	static final String moreMinutesOptionBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[6]/DIV[2]/TABLE/TBODY/TR[1]/TD[3]/INPUT");
	static final String noneMoreMinutesOptionBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[6]/DIV[2]/TABLE/TBODY/TR[2]/TD[3]/INPUT");
	static final String talkingLiberallyPrice = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[7]/DIV[2]/TABLE/TBODY/TR[1]/TD[2]/LABEL");
	static final String talkingLiberallyOptionBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[7]/DIV[2]/TABLE/TBODY/TR[1]/TD[3]/INPUT");
	static final String noneTalkingLiberallyOptionBtn = ("//DIV[@id='textMessagingPlans']/DIV[2]/DIV[7]/DIV[2]/TABLE/TBODY/TR[2]/TD[3]/INPUT");

	static final String shopPhoneTab = ("//LI[@id='buyflow_phones1']/A");
	static final String shopPlansTab = ("//LI[@id='buyflow_plans2']/A");
	static final String shopServicesTab = ("//LI[@id='buyflow_svcs']/A");
	static final String shopAccessoriesTab = ("//LI[@id='buyflow_access']/A");
	static final String checkOutTab = ("/LI[@id='buyflow_checkout_NO']");
	
	public boolean checkAllServiceTabsExist()
	{	
		boolean allServiceTabExist = true;
		allServiceTabExist = isElementVisible(shopPhoneTab);
		allServiceTabExist = isElementVisible(shopPlansTab);
		allServiceTabExist = isElementVisible(shopServicesTab);
		allServiceTabExist = isElementVisible(shopAccessoriesTab);
		allServiceTabExist = isElementVisible(checkOutTab);
		return (allServiceTabExist);
		
	}
	
	public boolean checkAllElementExist()
	{
		boolean allElementExist = true;
		
		allElementExist = isElementVisible(addButton1);
		allElementExist = isElementVisible(addButton2);
		allElementExist = isElementVisible(smartPhoneOptBtn);
		allElementExist = isElementVisible(smartPhoneWebPlanDtl);
		allElementExist = isElementVisible(smartPhoneWebPlanPrice);
		allElementExist = isElementVisible(textMessgingPlanDtl);
		allElementExist = isElementVisible(indTextMsg300Price);
		allElementExist = isElementVisible(indTextMsgOptBtn);
		allElementExist = isElementVisible(indTextMsgOptBtn);
		allElementExist = isElementVisible(unlimitedIndTextPlanPrice);
		allElementExist = isElementVisible(UnlimitedIndTextoptBtn);
		allElementExist = isElementVisible(noneTextMsgOptionBtn);
		allElementExist = isElementVisible(phoneInsuranceDtl);
		allElementExist = isElementVisible(phoneInsurancePrice);
		allElementExist = isElementVisible(phoneInsuranceOptBtn);
		allElementExist = isElementVisible(nonePhoneInsuranceOptBtn);
		allElementExist = isElementVisible(moreMinutesDetails);
		allElementExist = isElementVisible(talkingLiberallyDetails);
		allElementExist = isElementVisible(moreMinutesPrice);
		allElementExist = isElementVisible(moreMinutesOptionBtn);
		allElementExist = isElementVisible(noneMoreMinutesOptionBtn);
		allElementExist = isElementVisible(talkingLiberallyPrice);
		allElementExist = isElementVisible(talkingLiberallyOptionBtn);
		allElementExist = isElementVisible(noneTalkingLiberallyOptionBtn);
				
		return (allElementExist);
	}
	
	public void addServicesToCart()
	{	
		double totalPriceOfSelectedAccessories = 0;
		double priceOfSelectedAccessories = 0;
		
		if(BO.isChecked(smartPhoneOptBtn))
			{
				BO.click(addButton1);
		//		priceOfSelectedAccessories =(double)(BO.getText(smartPhoneWebPlanPrice).substring(1));
				 
			}
	}
	
	
}
